import axios from 'axios'
import md5 from 'md5'
export default {
  /**
   * 修改
   * @param {Object} data 数据对象
   */
  modify (data) {
    let params = {
      nickname: data.nickName,
      photo: data.avatar
    }
    if (data.pwd) {
      params.password = md5(data.oldPwd)
      params.newpassword = md5(data.pwd)
    }
    return axios.post('user/edit', params)
  }
}
